
//
//  WZEmotionButton.swift
//  weibo
//
//  Created by mac on 16/3/8.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class WZEmotionButton: UIButton {
    var emotion:WZEmojiModel?{
        didSet{
            if let OemotionPng = emotion?.png{
                
            
                let imagePath = "\(emotion!.path!)/\(OemotionPng)"
                
                self.setImage(UIImage(named: imagePath), forState: UIControlState.Normal)
                self.setTitle(nil, forState: UIControlState.Normal)
                self.hidden = false
            }
            
            
            if let OemotionEmoji = emotion?.emoji{
                
                self.setImage(nil, forState: UIControlState.Normal)
                self.setTitle(OemotionEmoji, forState: UIControlState.Normal)
                self.titleLabel?.font = UIFont.systemFontOfSize(35)
                self.hidden = false
            }

        }
    }

}
